<?php /*a:4:{s:56:"/home/pirate/wx_manager/app/appmsg/view/admin/index.html";i:1608033781;s:35:"../app/common/admin/lib/header.html";i:1622026634;s:36:"../app/common/admin/lib/sidebar.html";i:1606282475;s:35:"../app/common/admin/lib/footer.html";i:1620273611;}*/ ?>
<?php
use app\common\helper\appmsg_helper;
use app\appmsg\config\appmsg_config;
use app\common\model\User;
?>
<!doctype html>
<html>
<head>
  <meta charset="utf-8">
  <title><?php if($title): ?><?php echo htmlentities($title); ?>-<?php endif; ?>微信后台管理</title>
  <base href="<?php echo htmlentities(SITE_URL); ?>/"></base>
  <script type="text/javascript">
    var siteUrl = "<?php echo htmlentities(SITE_URL); ?>";
    var uploadUrl = "<?php echo htmlentities(UPLOAD_URL); ?>";
    var isAdmin = 1;
  </script>
  
  <link rel="stylesheet" type="text/css" href="./static/css/base.css" />
  <link rel="stylesheet" type="text/css" href="./static/css/admin/admin.css" />
  <link rel="stylesheet" href="/static/lib/layui-v2.5.4/css/layui.css" media="all">

  <?php if(in_array($module, explode(',', ',autoreply,appmsg,appmenu,appmenu_stat,key_stat,message,user'))): ?>
  <link rel="stylesheet" type="text/css" href="./static/css/admin/weixin.css" />
  <?php endif; ?>

  <script type="text/javascript" src="./static/js/jquery-1.7.1.min.js"></script>
  <script type="text/javascript" src="./static/js/jqueryui/1.8.11/jquery-ui.js"></script>
  <script type="text/javascript" src="./static/js/common.js"></script>
  <script type="text/javascript" src="./static/js/admin/admin.js"></script>
  <script type="text/javascript" src="./static/js/qDialog.js"></script>
  <script type="text/javascript" src="./static/js/zclip/jquery.zclip.min.js"></script>
  <script type="text/javascript" src="./static/js/zclip/ZeroClipboard.js"></script>
  <link rel="shortcut icon" href="./favicon.ico">
  <script src="/static/lib/layui-v2.5.4/layui.js?v=1.0.4" charset="utf-8"></script>
  <script src="/static/js/lay-config.js?v=1.0.4" charset="utf-8"></script>
  <link rel="stylesheet" href="/static//css/admin/weiboface.css" type="text/css" />
  <script type="text/javascript" src="/static//js/weiboface.js"></script>
  <!--[if IE 6]>
  <script src="./static/js/DD_belatedPNG_0.0.8a-min.js"></script>
  <script>
    DD_belatedPNG.fix('.logo a,.n-icon');
  </script>
  <![endif]-->
  <script>
  $(function(){
    // 页面高度
    var windowHeight = $(window).height();
    var domHeight = $(document).height();
    if (domHeight > windowHeight) {
      windowHeight = domHeight;
    }
    if ($(".inner-center").height() < windowHeight - 66) {
      $(".inner-center").css('min-height', windowHeight - 66);
      //$('body').css('overflow', 'hidden');
    }
    
    // 用户设置浮层
    $(".js_userSetBtn").click(function(e){
     e.preventDefault();
     e.stopPropagation();
     
     $(".js_cardSetBox").addClass('hidden');
     if ($(".js_userSetBox").hasClass('hidden')) {
       $(".js_userSetBox").removeClass('hidden');
     } else {
       $(".js_userSetBox").addClass('hidden');
     }
    });

      // 公众号下拉浮层
      $(".js_cardSetBtn").click(function(e){
          e.preventDefault();
          e.stopPropagation();

          $(".js_userSetBox").addClass('hidden');
          if ($(".js_cardSetBox").hasClass('hidden')) {
              $(".js_cardSetBox").removeClass('hidden');
          } else {
              $(".js_cardSetBox").addClass('hidden');
          }
      });

      // 表情初始化
      weiboFaceInit({
          //emotionUrl: "javascript:;",
          data: <?php echo config('emotion.weixin_emotions'); ?>
      });
  });
  </script>
</head>
<body>

<div id="wrap">
  <div class="header">
    <div class="htop clearfix">
      
      <h1 class="logo left" style="width:300px;"><a href="<?php echo url('admin'); ?>">微信后台管理 [<?php echo htmlentities($open_card_info['title']); ?>] </h1>
      <?php if($user_id > 0): ?>
        
        <div class="infotop">
          <a href="javascript:void(0);" class="userpic"></a>
          <span class="username-right js_userSetBtn">
            <a href="javascript:;" class="username"><?php echo User::display_name($user_id); ?></a>
            <span class="arrowtop">
              <i></i>
            </span>
          </span>
          <div class="poptop poptop-user js_userSetBox hidden" style="background:white;">
            <em>◆</em>
            <ul>
              
              <li><a href="<?php echo url('home'); ?>">回前台</a></li>
              <li><a href="<?php echo url('/admin/logout/index'); ?>">退出</a></li>
            </ul>
          </div>
        </div>
      <?php else: ?>
        <div class="htop-login right">
          <a href="<?php echo url('admin'); ?>">登录</a>
          <a href="<?php echo url('user/register'); ?>">注册</a>
        </div>
      <?php endif; ?>
    </div>
  </div>
  <div class="container clearfix">
    <div class="sidebar left">
  <ul class="sidenav">
  <!-- {an_dump($sidebar_menu_list)} -->
    <?php foreach($sidebar_menu_list as $k=>$v): ?>
    <li class="js_topMenu">
      <a href="javascript:;"><?php echo htmlentities($v['title']); ?><em></em></a>
      <?php if($v['children']): ?>
      <ul class="sidenav2" style="display:none;">
        <?php foreach($v['children'] as $k1=>$v1): ?>
        <li class="<?php echo htmlentities($v1['curr']); ?>">
          <a href="<?php echo htmlentities($v1['url']); ?>" data-qian="vmodule::<?php echo htmlentities($v1['module']); ?> vcontroller::<?php echo htmlentities($v1['controller']); ?> vaction::<?php echo htmlentities($v1['action']); ?> ___ module::<?php echo htmlentities($module); ?> controller::<?php echo htmlentities($controller); ?> action::<?php echo htmlentities($action); ?> __ vextra::<?php echo htmlentities($v1['extra_res']); ?> extra::<?php echo htmlentities($extra_res); ?> vcurr::<?php echo htmlentities($v1['curr']); ?>"><?php echo htmlentities($v1['title']); ?>&nbsp;&nbsp;<i style="display:none;" style="color:red">(0)</i></a>
        </li>
        <?php endforeach; ?>
      </ul>
      <?php endif; ?>
    </li>
    <?php endforeach; ?>
  </ul>
</div>
<script>
$(function(){
  $('.js_topMenu').click(function(e){
    
    var s=e.target || e.srcElement;
    if ($(s).parents(".sidenav2").size()>0) {
      return;
    }

    $(this).siblings().removeClass('curr')
    $(this).siblings().find('ul:visible').slideUp();
    if (!$(this).find('ul:visible').length) {
      $(this).find('ul').slideDown();
      $(this).addClass('curr');
    } else {
      $(this).find('ul').slideUp();
      $(this).removeClass('curr');
    }
  });
  
  $(".sidenav2 li").each(function(i, n){
    if ($(this).hasClass('curr')) {
      $(this).closest('ul').show();
      $(this).closest('.js_topMenu').addClass('curr');
    };
  });
});
</script>
    <div class="center">
      <div class="inner-center">
  <div class="page-header border-bottom clearfix">
    <h2 class="left">图文管理<span>在这里对图文进行管理</span></h2>
    
    <a href="<?php echo url('/appmsg/add/2'); ?>" class="btn btn-success btn-sm right">添加多图文</a>
    <a href="<?php echo url('/appmsg/add/1'); ?>" class="btn btn-success btn-sm right">添加单图文</a>
    <a href="javascript:void(0);" class="btn btn-default btn-sm right js_advancedSearchBtn">搜索</a>
  </div>
  <div class="search-form js_advancedForm" <?php if(!$search_filter): ?>style="display:none;"<?php endif; ?>>
    <form action="/appmsg/admin" method="get" class="js_appmsgSearchForm">
      <input type="hidden" name="status" value="<?php echo htmlentities($status); ?>">
      <input type="hidden" name="need_store_id" value="<?php echo htmlentities($need_store_id); ?>">
      <input type="hidden" name="type" value="<?php echo htmlentities($type); ?>">
      <input type="hidden" name="verify" value="<?php echo htmlentities($verify); ?>">
      <input type="hidden" name="area_id" value="<?php echo htmlentities($area_id); ?>">
      <p>
        <label for="" class="search-f-label">标题：</label>
        <input type="text" class="search-f-ipt1" name="search_filter[title]" value="<?php echo htmlentities($search_filter['title']); ?>">
      </p>
      <p>
      <label for="" class="search-f-label">添加时间：</label>
        <input type="text" class="search-f-ipt1 search-f-ipt2" name="search_filter[start_date]" value="<?php echo htmlentities($search_filter['start_date']); ?>" id="startDate">
        <span class="search-f-line"></span>
        <input type="text" class="search-f-ipt1 search-f-ipt2" name="search_filter[stop_date]" value="<?php echo htmlentities($search_filter['stop_date']); ?>" id="stopDate">
      </p>
      <p><label for="" class="search-f-label"></label><button type="submit" class="btn btn-success btn-xs js_searchBtn">搜索</button></p>
    </form>
  </div>
  
  <!---->
  <!--<?php if($store_id >= 1): ?>-->
    <!--<?php echo htmlentities($admin_appmsg_info = appmsg_helper::get_store_last_appmsg_info(0)); ?>-->
    <!--<?php if($admin_appmsg_info): ?>-->
    <!--<div class="alert add-form-title">-->
      <!--<strong>总后台最新图文素材</strong>-->
    <!--</div>-->
    <!--<table class="list-table">-->
      <!--<thead>-->
        <!--<tr>-->
          <!--<th style="width:100px;">封面图</th>-->
          <!--<th style="width:220px;">图文标题</th>-->
          <!--<th style="width:120px;">添加时间</th>-->
          <!--<th>操作</th>-->
        <!--</tr>-->
      <!--</thead>-->
      <!--<tbody>-->
          <!--<tr data-id="<?php echo htmlentities($admin_appmsg_info['id']); ?>" class="bg-gray">-->
            <!--<td><img src="{_image($admin_appmsg_info.cover, 'small')}" width="100" /></td>-->
            <!--<td>-->
              <!--<div><span style="color:#b1b1b1;">[1]</span> <?php echo htmlentities($admin_appmsg_info['title']); ?></div>-->
              <!--<?php if($admin_appmsg_info['type'] == 2): ?>-->
                <!--<?php echo htmlentities($son_appmsg_list = appmsg_helper::get_merge_appmsg_list($admin_appmsg_info['id'])); ?>-->
                <!--<?php foreach($son_appmsg_list as $k1=>$v1): ?>-->
                <!--<div><span style="color:#b1b1b1;">[<?php echo htmlentities($k1+2); ?>]</span> <?php echo htmlentities($v1['title']); ?></div>-->
                <!--<?php endforeach; ?>-->
              <!--<?php endif; ?>-->
            <!--</td>-->
            <!--<td>{time_format($admin_appmsg_info.add_time)}</td>-->
            <!--<td>-->
                <!--<a href='javascript:void(0);' data-id="<?php echo htmlentities($admin_appmsg_info['id']); ?>" class="btn btn-default btn-xs js_previewBtn">预览</a>-->
            <!--</td>-->
          <!--</tr>-->
      <!--</tbody>-->
    <!--</table>-->
    <!--<div style="margin-bottom:20px;"></div>-->
    <!--<div class="alert add-form-title">-->
      <!--<strong>本店铺图文素材</strong>-->
    <!--</div>-->
    <!--<?php endif; ?>-->
  <!--<?php endif; ?>-->
  
  <div class="filter-box">按状态：
    <a href='<?php echo url("/appmsg/admin/index",["status"=>1]); ?>' <?php if($status == 1): ?> class="label label-primary" <?php else: ?> class="label label-default" <?php endif; ?>>正常</a>
    <a href='<?php echo url("/appmsg/admin/index",["status"=>0]); ?>' <?php if($status == 0): ?> class="label label-primary" <?php else: ?> class="label label-default" <?php endif; ?>>已删除</a>
  </div>

  <!--start:列表-->
  <table class="list-table">
    <thead>
      <tr>
        <th style="width:20px;"><input type="checkbox" class="selectAll"></th>
        <th style="width:100px;">封面图</th>
        <th style="width:220px;">图文标题</th>
        <th style="width:100px;">是否审核</th>
        <th style="width:120px;">是否推送过</th>
        <th style="width:100px;">发布途径</th>
        <th style="width:80px;">阅读/转发</th>
        <th style="width:130px;">添加时间</th>
        <th>操作</th>
      </tr>
    </thead>
    <tbody>
    <?php if(isset($list['data'])): foreach($list['data'] as $k=>$v): ?>
        <tr id="dataList<?php echo htmlentities($v['id']); ?>" <?php if($k%2 == 1): ?> class="bg-gray" <?php endif; ?>>
          <td><input type="checkbox" class="listSelect"></td>
          <td>
            <?php if($v['store_id'] == 0): ?>
            <img src="<?php echo _image($v['cover'], 'small'); ?>" width="100" />
            <?php else: ?>
            <img src="<?php echo _image($v['cover'], 'small_equal'); ?>" width="100" />
            <?php endif; ?>
          </td>
          <td>
          <div><span style="color:#b1b1b1;">[1]</span> <?php echo htmlentities($v['title']); ?></div>
          <?php if($v['type'] == 2): ?>
          <?php echo htmlentities($son_appmsg_list = appmsg_helper::get_merge_appmsg_list($v['id'])); foreach($son_appmsg_list as $k1=>$v1): ?>
          <div class="js_preSonItem" data-id="<?php echo htmlentities($v1['id']); ?>"><span style="color:#b1b1b1;">[<?php echo htmlentities($k1+2); ?>]</span> <?php echo htmlentities($v1['title']); ?></div>
          <?php endforeach; ?>
          <?php endif; ?>
          </td>

          <td><?php if($v['verify'] >= 1): ?><?php echo appmsg_config::$verify_relation[$v['verify']]; else: ?>--<?php endif; if($v['verify'] == 3): ?>
              <?php echo htmlentities($verify_record_info = appmsg_helper::get_verify_record_info($v['id'])); if($verify_record_info && $verify_record_info['reason']): ?>
              <div style="color:#aaa;"><span style="color:#bbb;">原因：</span><?php echo htmlentities($verify_record_info['reason']); ?></div>
              <?php endif; ?>
          <?php endif; ?>
          </td>

          <td><div class="js_preSyncStatus"><?php if($v['send'] == 1): ?>已推送过<br><?php echo htmlentities(time_format($v['send_time'])); else: ?>--<?php endif; ?></div></td>
          <td>后台</td>
          <td>阅读：<?php echo htmlentities($v['view_num']); ?><br>转发：<?php echo htmlentities($v['rt_num']); ?>
          </td>
          <td><?php echo htmlentities(time_format($v['add_time'])); ?></td>

          <td>
            <?php if($status == 1): ?>
              <a href='javascript:void(0);' data-store="<?php echo htmlentities($v['store_id']); ?>" data-id="<?php echo htmlentities($v['id']); ?>" class="btn btn-default btn-xs js_previewBtn">预览</a>
              <!--{*管理员才有做审核与同步操作*}-->
              <a href='javascript:void(0);' data-id="<?php echo htmlentities($v['id']); ?>" class="btn btn-success btn-xs js_syncBtn" style="">同步到公众号</a>
              <?php if($v['verify'] == 1): if($store_id == 0 && $v['store_id'] >= 1): ?>
                <a href='javascript:void(0);' data-id="<?php echo htmlentities($v['id']); ?>" data-verify="3" class="btn btn-default btn-xs js_verifyBtn">打回</a>
                <?php endif; elseif($v['verify'] == 2): if($store_id == 0): ?>
                <div class="s-users-add js_selectWrap">
                  <span data-status="1" class="js_currSelect">审核处理<em></em></span>
                  <div class="s-users-add-box js_selectList" style="display:none;">
                    <ul>
                      <li class="js_verifyBtn" data-id="<?php echo htmlentities($v['id']); ?>" data-verify="1">通过</li>
                      <li class="js_verifyBtn" data-id="<?php echo htmlentities($v['id']); ?>" data-verify="3">打回</li>
                    </ul>
                  </div>
                </div>
                <?php endif; else: if($store_id >= 1): ?>
                <a href='javascript:void(0);' data-id="<?php echo htmlentities($v['id']); ?>" data-verify="2" class="btn btn-warning btn-xs js_verifyBtn">提交审核</a>
                <?php endif; ?>
              <?php endif; ?>

            <!--{*后台管理员随时可编辑，店铺管理员只能在未提交和打回后可编辑*}  href="<?php echo url("/open_card/admin/edit",["id" => $v['id']]); ?>"-->
            <?php if($store_id || ($store_id >= 1 && $v['verify'] >= 3)): ?>

              <a <?php echo htmlentities($type = $v['type']); ?> href="<?php echo url("/appmsg/add/$type",["id" => $v['id']]); ?>" class="btn btn-info btn-xs">编辑</a>
              <a href='<?php echo url("/appmsg/delete/admin"); ?>' class="btn btn-danger btn-xs deleteOne">删除</a>
            <?php endif; elseif($status == 0): ?>
            <a href='<?php echo url("/appmsg/admin/change_status",["status"=>1]); ?>' class="btn btn-success btn-xs changeStatus"><i class="icon-trash icon-white"></i>恢复</a>

            <?php endif; ?>
          </td>
        </tr>
        <?php endforeach; else: ?>
          <tr><td class="txtleft" colspan="9">暂无数据</td></tr>
    <?php endif; ?>
    </tbody>
    <tfoot><tr><td><input type="checkbox" class="selectAll"></td><td colspan="8"><a href='<?php echo url("/appmsg/delete/admin"); ?>' class="btn btn-danger btn-xs deleteAll">批量删除</a></td></tr></tfoot>
  </table>

<div id="pages"></div>

<!--end:列表-->
<script type="text/javascript" src="./static/js/module/appmsg.js"></script>
<script>
$(function(){
  // 高级搜索时间验证
  $('.js_searchBtn').click(function(e){
    e.preventDefault();
    var thisObj   = $(this);
    var startDate = $.trim($('#startDate').val());
    var stopDate  = $.trim($('#stopDate').val());
    if (startDate > stopDate) {
      showMsg('结束时间应大于等于开始时间');
      return;
    }
    thisObj.closest('form').submit();
  });
  
  // 更改分类
  $(".js_verifyBtn").live('click', function(e){
    e.preventDefault();
    
    var thisObj = $(this);
    var verify = thisObj.attr('data-verify');
    var selectId = $(this).closest("tr").attr("id").substring(8);
    
    if (!selectId) {
      showMsg('请选择要操作记录');
      return false;
    }
    
    var postUrl  = siteUrl+'/appmsg/admin/verify';
    var postData = { 'id':selectId, 'verify':verify };
    
    if (thisObj.attr('is-post') == 1) {
      showMsg('数据正在提交中，请耐心等待');
      return false;
    }
    thisObj.attr('is-post', 1);
    
    showConfirm('确定要执行此操作吗？', 1, function(){
      
      // 如果是打回，填写打回原因
      if (verify == 3) {
        var contentHtml = '<div>';
        contentHtml += '<div style="padding:10px 13px;">请填写打回原因</div>';
        contentHtml += '<div style="padding-left:13px;"><textarea name="verify_reason" style="width:260px; height:80px;"></textarea></div>';
        contentHtml += '</div>';
        var content    = $(contentHtml);
        var DD = ace.dialog({
          'title':'微信扫码预览',
          'content':content,
          'init':function(){
            content.closest('.aceDialog').css('width', '300px');
            //content.closest('.aceDialog').find('.okBtn').css('margin-left', '30px');
          },
          'ok':function(){
            var reason = $.trim($(":input[name='verify_reason']").val());
            if (!reason) {
              thisObj.attr('is-post', 0);
              showMsg('请填写打回的原因');
              return false;
            }
            
            postData['reason'] = reason;
            postVerify(thisObj, postUrl, postData, function(){
              DD.close();
            });
          },
          'close':function(){
            thisObj.attr('is-post', 0);
          }
        });
        
        // 其它状态
      } else {
        postVerify(thisObj, postUrl, postData);
      }
    }, function(){
      thisObj.attr('is-post', 0);
    });
  });
  
  /**
   * 审核处理
   * @param thisObj 当前操作的节点
   * @param postUrl post地址
   * @param postData post的数据
   * @param okFunc 成功后的回调
   */
  function postVerify(thisObj, postUrl, postData, okFunc)
  {
    $.post(postUrl, postData, function(json){
      if (json.info != 'ok') {
        thisObj.attr('is-post', 0);
        showMsg(json.info);
        return false;
      }
      
      thisObj.closest("tr").fadeOut(function(){
        $(this).remove();
        interLineColor();
      });
      
      if (okFunc && typeof okFunc == 'function') {
        okFunc();
      }
      
      //thisObj.closest("tr").find(".js_tycategory_idText").text(json.category_id_value);
      //thisObj.closest("tr").find(".js_selectList").hide();
    }, 'json').error(function(){
      thisObj.attr('is-post', 0);
    });
  }
  
  // 同步
  $(".js_syncBtn").click(function(e){
    e.preventDefault();
    
    var thisObj = $(this);
    var id = thisObj.attr('data-id');
    
    if (thisObj.attr('is-post') == 1) {
      showMsg('数据正在提交中，请耐心等待');
      return false;
    }
    thisObj.attr('is-post', 1);
    showConfirm('你确定要执行审核操作吗？', 1, function(){
      $.post(siteUrl+'/appmsg/sync/sync_news', { 'id':id }, function(json){
        thisObj.attr('is-post', 0);
        if (json.info != 'ok') {
          showMsg(json.info);
          return false;
        }
        
        showMsg('同步成功', 1);
        thisObj.closest('tr').find('.js_preSyncStatus').html('已同步<br>'+json.sync_time);
      }, 'json').error(function(){
        thisObj.attr('is-post', 0);
        showMsg('网络异常，请稍后再试');
      });
    }, function(){
      thisObj.attr('is-post', 0);
    });
  });

  // 页面复制
  var clip = new ZeroClipboard( $('.js_copyList'), {
    moviePath: "../../../../js/zclip/ZeroClipboard.swf"
  });
  clip.on( 'complete', function(client, args) {
    showMsg("复制成功，复制店铺为："+ args.text, 1);
  });
});
</script>
      </div>
      
    </div>
  </div>
      
      <div class="linkpop js_menuSetBox" style="display:none;">
          <div class="inner-linkpop">
      <span>
        <i class="arrowpop"></i>
        <b class="arrowpop2"></b>
      </span>
              <p class="options-list">
                  <!--<a class="js_menuIndexBtn" href="javascript:void(0);">关联到微官网</a>-->
                  <a class="js_menuLinkBtn" href="javascript:void(0);">跳转到网页</a>
                  <a class="js_menuTextBtn" href="javascript:void(0);">纯文字回复</a>
                  <a class="js_menuSingleBtn" href="javascript:void(0);">单条图文信息</a>
                  <a class="js_menuMultiBtn" href="javascript:void(0);">多条图文信息</a>
                  <a class="js_menuActivityBtn" href="javascript:void(0);">活动回复</a>
                  <!--{*<a class="js_menuImgBtn" href="javascript:void(0);">图片</a>-->
                  <!--<a class="js_menuVoiceBtn" href="javascript:void(0);">声音</a>-->
                  <!--<a class="js_menuCustomBtn" href="javascript:void(0);">智能回复</a>*}-->
              </p>
          </div>
      </div>

</div>
<span class="goTop go-top-box" style="display:none;"></span>
<script>
$(function(){
  // to-top
  goTopEx($(".goTop")[0]);
  // 点击其他地方隐藏弹层
  $(document).click(function(e){
    var s=e.target || e.srcElement;
    // 隐藏图文信息的编辑框
    if (!$(s).is('.js_showSetBoxBtn') && !$(s).is('.js_setBox') && $(s).parents(".js_setBox").size()<1) {
      $(".js_setBox").addClass('hidden');
    }
    
    // 隐藏个人设置弹框
    if (!$(s).is('.js_userSetBtn') && !$(s).is('.js_userSetBox') && $(s).parents(".js_userSetBox").size()<1) {
      $(".js_userSetBox").addClass('hidden');
    }
    
    // 隐藏个人设置弹框
    if (!$(s).is('.js_cardSetBtn') && !$(s).is('.js_cardSetBox') && $(s).parents(".js_cardSetBox").size()<1) {
      $(".js_cardSetBox").addClass('hidden');
    }
    
    // 隐藏菜单设置弹框
    if (!$(s).is('.js_setBtn') && !$(s).is('.js_menuSetBox') && $(s).parents(".js_menuSetBox").size()<1 && !$(s).is('.js_addNewContent') && $(s).parents(".js_addNewContent").size()<1) {
      $(".js_menuSetBox").hide();
    }
    
    // 隐藏表情弹框
    if (!$(s).is('#weiboface') && $(s).parents("#weiboface").size()<1 && !$(s).is('.js_faceBtn') && $(s).parents(".js_faceBtn").size()<1) {
      $("#weiboface").hide();
    }
    
    // 隐藏首页二维码
    if (!$(s).is('.js_mPreviewBtn') && $(s).parents(".js_mPreviewBtn").size()<1 && !$(s).is('.js_mPreviewBox') && $(s).parents(".js_mPreviewBox").size()<1) {
      $(".js_mPreviewBox").hide();
    }
    
    // 隐藏颜色框
    if (!$(s).is('.js_selectColorBtn') && $(s).parents(".js_selectColorBtn").size()<1 && !$(s).is('.js_selectColorBox') && $(s).parents(".js_selectColorBox").size()<1) {
      $(".js_selectColorBox").hide();
    }
    
    // 隐藏图标框
    if (!$(s).is('.js_selectIconBtn') && $(s).parents(".js_selectIconBtn").size()<1 && !$(s).is('.js_selectIconBox') && $(s).parents(".js_selectIconBox").size()<1) {
      $(".js_selectIconBox").hide();
    }
  });

    layui.use(['form', 'laypage'], function () {
        var form = layui.form
            , laypage = layui.laypage;

        laypage.render({ //分页
            elem: 'pages'
            , count: "<?php echo htmlentities($list['total']); ?>"
            , theme: '#FFB800'
            , limit: "<?php echo htmlentities($list['per_page']); ?>"
            , curr: "<?php echo htmlentities($list['current_page']); ?>"
            , jump:function(obj, first) {
                if (!first) {
                    //location.href = "?page="+obj.curr
                    var query = window.location.href;

                    var url = query.split("?")[0]+"?page="+obj.curr;
                    location.href = url;
                }
            }
        });
    });
});
</script>
</body>
</html>